package com.qiqidream.admin.system.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.qiqidream.admin.common.base.BaseEntity;
import com.qiqidream.admin.common.entity.AuthJson;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;

/**
 * 系统管理-角色表
 * @author QiQiDream
 * @since 2019/11/18 10:53
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@TableName(autoResultMap = true,value = "sys_role")
public class Role extends BaseEntity {
    /**
     * 角色编码
     */
	@ApiModelProperty(value = "角色编码")
	@NotBlank(message = "角色编码不能为空")
	@Length(max = 20, message = "角色编码不能超过20个字符")
	private String code;

    /**
     * 角色名称
     */
	@ApiModelProperty(value = "角色名称")
	@NotBlank(message = "角色名称不能为空")
	private String name;

    /**
     * 角色描述
     */
	@ApiModelProperty(value = "角色描述")
	private String remark;

	/**
	 * 授权数据(JSON)
	 */
	@ApiModelProperty(value = "授权数据(JSON)")
	@TableField(typeHandler = FastjsonTypeHandler.class)
	private AuthJson authJson;

}
